package com.hydra.base.config;

import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.util.TimeZone;

/**
 * Druid数据源的配置类
 * @Author Hydra
 * @Date 2022/5/18 9:40
 */
@Configuration
public class DruidConfig {

    /*
     * 解决druid 日志报错：discard long time none received connection:xxx
     * */
    @PostConstruct
    public void setProperties(){
        System.setProperty("druid.mysql.usePingMethod","false");
        //设置时区为东八区
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
    }

}
